package tools.clustering;

public class DoubleLink extends Link{

	public DoubleLink(String s, String t, Double i) {
		super(s, t, i);
	}

	public Double getInteraction(){
		return (Double) super.getInteraction();
	}
	
	public int compareTo(Link o){
		if(super.getSource().equals(o.getSource())&&super.getTarget().equals(o.getTarget())){
			if(this.getInteraction()==o.getInteraction()){
				return 0;
			}else if(this.getInteraction()<(Double)o.getInteraction()){
				return -1;
			}else{
				return +1;
			}
		}else{
			throw new ClassCastException("Not link between the same node");
		}
	}
}
